// ----------------------
// ####### ogre #########
// ----------------------
// main and graphics
// a lot of this shit got to be reorganized

namespace loop
{
    void moveTo(ushort idx, Vec3 dest, float speed = 3.f);
    void setCameraMode(int mode);
    void diagnose();
    void check_mouse_hover();
    void find_near_objects(Ogre::Vector3 pos, float radius);
}
// ------------------------------
// ####### bullet physics #######
// ------------------------------
#ifdef USE_BULLET
namespace physics
{
    void init();
    void update();

    void add_col_obj(size_t);
    btBroadphaseInterface           * broadphase;
    btDefaultCollisionConfiguration * collisionConfig;
    btCollisionDispatcher           * dispatcher;
    btCollisionWorld                * colw;
    //btCharacterControllerInterface * char_ctrl;
    BtOgre::StaticMeshToShapeConverter * mesh2shape;
    BtOgre::DebugCollisionDrawer * col_dgb;
}
#endif
// -------------------------
// ####### OIS inputs ######
// -------------------------
namespace inputs
{
    OIS::InputManager * inputmanager;
    OIS::Keyboard * keyboard;
    OIS::Mouse * mouse;

    void init();
}
namespace interface // includes gorilla
{
    Gorilla :: Silverback   * mGorilla;
    Gorilla :: Screen       * gor_screen;
    Gorilla :: Rectangle    * gor_rect;
    Gorilla :: Layer        * gor_layer;
    Gorilla :: Caption      * gor_caption[15];
    OgreConsole * console;

    Bar cast_bar;
}
namespace recoil
{
    void trigger_pull();
    void trigger_release();

    SceneNode * n_recoil;
    float recoil_pitch, recoil_yaw, kickback, recoil_cap, cooldown_step, time_stack, fire_delay;
    bool stop, trigger_pulled;
    float recoil(float);
    void recoil_event();
    float smoothstep(float x);
    float smoothstep2(float,float,float);
    float smoothstep_fast(float x);
    float weight_avg(float x, float goal, float slowdown);
}
namespace bullets
{
    void fire_trace();

    float bullet_speed, bullet_speed, offset_x, offset_y
    int nextbullet;
    BillboardChain                  * bb_trace_model;
    std::vector<SceneNode *>        n_bullet;
    std::vector<BillboardChain *>   bb_trace;
    BillboardChain * MakeABullet(string);
}
namespace laser
{
    float  laser_width;
    btVector3 btfrom, btto;
    Vec3 from, to;

    Entity  * last_entity, * current_entity,
            * previous_rayed, * current_rayed;
    SceneNode * n_laserdot, * n_laserbeam;

    BillboardSet * bb_laserdot;
    BillboardChain * bb_beam;
    // Billboard * bboard;

    std::vector<BillboardSet *> bb_dot;
    Ray ray;
    RaySceneQuery * rsq;
#ifdef USE_BULLET
    btCollisionWorld::ClosestRayResultCallback raycallback;
    std::vector<bullet_raycast>     callbacks;
#endif
}

// std::map<std::string, Vec3> diagnose_vect;
// std::map<std::string, float> diagnose_float;
// Vec3 offset;
int main()
{



}